<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use common\models\MktPost;

?>
<!--
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta name="keywords" content="首页关键字" />
  <meta name="description" content="首页描述" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Cache-Control" content="no-cache" />
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=2.0" />
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  
  <link rel="stylesheet" href="../resources/css/weui/weui.min.css">
  <link rel="stylesheet" href="../resources/css/main.min.css">
  <link rel="stylesheet" href="../resources/css/man.min.css">
  
  <script src="../resources/js/jquery-1.10.min.js"></script>
  <script src="../resources/js/jquery.touchSwipe.min.js"></script>
  <script src="../resources/js/frmwebm.min.js"></script>
  <title>职位描述</title>
  <style>
  textarea::-webkit-input-placeholder::before {
    display:block;
    content:"例子：\A 1. 向潜在客户推广品牌，介绍课程及相关活动；\A 2. 负责协助市场推广活动，并筹备市场活动的物料；\A 3. 分发市场宣传资料，收集潜在客户的相关信息；\A 4. 按公司要求参加推广活动，并按时按量完成推广任务；\A 5. 协助公司的其它宣传。";
  }
.weui_cells_checkbox label{
	border: 1px solid #C8C8C8;
    padding-left: 5px;
    padding-right: 5px;
    padding-bottom: 1px;
    padding-top: 3px;
}
.weui_cells_checkbox .weui_check:checked+.weui_icon_checked:before{
	color: #999999;
}
</style>
</head>
<body style="background: #ebebeb none repeat scroll 0 0;">
-->
<?php $this->title = '职位描述' ?>

  <style>
  textarea::-webkit-input-placeholder::before {
    display:block;
    content:"例子：\A 1. 向潜在客户推广品牌，介绍课程及相关活动；\A 2. 负责协助市场推广活动，并筹备市场活动的物料；\A 3. 分发市场宣传资料，收集潜在客户的相关信息；\A 4. 按公司要求参加推广活动，并按时按量完成推广任务；\A 5. 协助公司的其它宣传。";
  }
.weui_cells_checkbox label{
	border: 1px solid #C8C8C8;
    padding-left: 5px;
    padding-right: 5px;
    padding-bottom: 1px;
    padding-top: 3px;
}
.weui_cells_checkbox .weui_check:checked+.weui_icon_checked:before{
	color: #999999;
}
</style>

<?php $form = ActiveForm::begin([
		'id' => 'myform',
		'fieldConfig' => [
				//'template' => "{input}\n{error}",
                'template' => "{input}",
				'options' => ['tag' => false],
		],
]); ?>

<?php echo $form->errorSummary($model, ['header'=>'']); ?>

<div class="weui_form">
	<div class="weui_form_item">
		<label class="weui_form_label">招聘职位名称<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
			<?php echo $form->field($model, 'title')->textInput(['id'=>'title', 'maxlength' => true, 'class'=>'weui_form_input', 'style'=>'width:100%;', 'placeholder'=>'请输入招聘职位（最多20字）']) ?>

		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">月薪范围<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
			<?php echo $form->field($model, 'job_salary_min')->dropDownList(MktPost::getPostJobSalaryMinOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;'] ) ?>
			<?php echo $form->field($model, 'job_salary_max')->dropDownList(MktPost::getPostJobSalaryMaxOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;'] ) ?>
		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">工作区域<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php echo $form->field($model, 'parent_area_id')->dropDownList(\yii\helpers\ArrayHelper::map(
                \common\models\MktArea::find()->children()->all(),
                'id',
                'title'
            ), ['prompt'=>'选择区域...', 'id'=>'parent_area_id', 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;']); ?>

            <?php echo $form->field($model, 'area_id')->label('商圈')->widget(\kartik\depdrop\DepDrop::classname(), [
                'options' => ['id' => 'area_id', 'class'=>'weui_form_input', 'style'=>'width:50%;color:#A5A5A5;'],
                'pluginOptions'=>[
                    'depends'=>['parent_area_id'],
                    'placeholder' => '选择商圈...',
                     'initialize' => $model->isNewRecord ? false : true,
                    
                    //'url' => Url::to('@backendUrl/index.php?r=area/subcat'),
                    'url' => Url::to(['area-subcat']),                    
                ]
            ]); ?>

		</div>
	</div>
</div>

<div class="weui_form">
	<div class="weui_form_item">
		<label class="weui_form_label">学历要求<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php echo $form->field($model, 'job_education')->dropDownList(MktPost::getPostJobEducationOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:100%;color:#A5A5A5;'] ) ?>

		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">工作经验<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php echo $form->field($model, 'job_experience')->dropDownList(MktPost::getPostJobExperienceOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:100%;color:#A5A5A5;'] ) ?>

		</div>
	</div>
	<div class="weui_form_item">
		<label class="weui_form_label">年龄要求<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php //echo $form->field($model, 'job_age_min')->textInput(['maxlength' => true, 'class'=>'weui_form_input', 'style'=>'width:100%;', 'placeholder'=>'']) ?>
            <?php //echo $form->field($model, 'job_age_max')->textInput(['maxlength' => true, 'class'=>'weui_form_input', 'style'=>'width:100%;', 'placeholder'=>'']) ?>
            <?php echo $form->field($model, 'job_age_min')->dropDownList(MktPost::getPostJobAgeMinOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:100%;color:#A5A5A5;'] ) ?>
            <?php echo $form->field($model, 'job_age_max')->dropDownList(MktPost::getPostJobAgeMaxOption(),['onchange'=>"change(this);", 'class'=>'weui_form_input', 'style'=>'width:100%;color:#A5A5A5;'] ) ?>
		</div>
	</div>
</div>

<div class="weui_form">
	<div class="weui_form_item">
		<label class="weui_form_label">岗位职责<span style="color:red;"> *</span></label>
		<div class="weui_form_inputBox">
            <?php echo $form->field($model, 'content')->textarea(['id'=>'content', 'rows'=>5, 'class'=>'weui_form_input', 'style'=>'width:100%;height:120px;line-height:18px;', 'placeholder' => '']); ?>

		</div>
	</div>
</div>

<div style="margin: 0px 15px;">
		<table class="weui_cells_checkbox" style="position: relative;margin-top:25px;margin-bottom:25px;font-size: 14px;height:18px;line-height:18px;color:#999999;">
			<tr>
				<td>
					<input id="radio" type="checkbox" class="weui_check" name="radio">
					<i class="weui_icon_checked"></i>

                    <?php echo $form->field($model, 'is_anoymous')->textInput(['id'=>'is_anoymous','class'=>'hide']); ?>

				</td>
				<td>
					<label id="radiolabel" onclick="clickRadio()" style="margin-left: 5px;margin-right: 10px;">匿名发布</label>
				</td>
				<td>
					<span style="font-size: 12px;">什么是匿名发布？</span>
				</td>
			</tr>
		</table>
	
	<div>
        <a id="mybutton" href="#" class="weui_btn weui_btn_warn" style="color:#ffffff">发布</a>

	</div>
</div>
<?php ActiveForm::end(); ?>


<script type="text/javascript">

function change(self)
{
	var obj = $(self)[0];
	var index = obj.selectedIndex;
	if(index==0)
		obj.style.color="#A5A5A5";
	else
		obj.style.color="#000000";
}

function clickRadio(self)
{
	var radio = $("#radio");
    var is_anoymous = $("#is_anoymous");

	if(radio.attr("checked"))
	{
		radio[0].removeAttribute("checked");
        is_anoymous.val(0);
	}
	else
	{
		radio[0].setAttribute("checked", "checked");
        is_anoymous.val(1);
	}
}

$("#mybutton").click(function(e){
	var temp = document.getElementById("title");
	if( temp.value.length == 0)
	{
        frmwebm.prompt({
            title: "友情提示",
            content: '招聘职位名称不能为空！'
        });
		temp.focus();
		return false;
	}

	var temp = document.getElementById("content");
	if( temp.value.length == 0)
	{
        frmwebm.prompt({
            title: "友情提示",
            content: '岗位职责不能为空！'
        });
		temp.focus();
		return false;
	}

	var temp = document.getElementById("area_id");
	if( temp.value.length == 0)
	{
        frmwebm.prompt({
            title: "友情提示",
            content: '工作区域不能为空！'
        });
		temp.focus();
		return false;
	}

    var isNewRecord = <?php echo $model->isNewRecord ? 1 : 0 ?>;
    if (isNewRecord)
    {
        var postCountToday = <?php echo $me->getPostCountToday() ?>;
        if (postCountToday >= <?php echo Yii::$app->keyStorage->get('business.post_per_day', 3) ?>)
        {
            frmwebm.prompt({
                title: "温馨提示",
                content:"您每天只限发<?php echo Yii::$app->keyStorage->get('business.post_per_day', 3) ?>个贴子!"
            });
            return false;
        }
    }

    $("#myform").submit();
});

</script>

<!--
</body>
</html>
-->

<?php
/*
<!--
			<textarea type="text" class="weui_form_input" style="width:100%;height:120px;line-height:18px;" name="select2" placeholder="."></textarea>
-->

<!--
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择最低起薪</option>
				<option value="1">10人以下</option>
				<option value="2">10 - 30人</option>
			</select>
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择最高薪水</option>
				<option value="1">10人以下</option>
				<option value="2">10 - 30人</option>
			</select>
-->
<!--
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择行政区</option>
				<option value="1">北京</option>
				<option value="2">上海</option>
			</select>
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择商圈</option>
				<option value="1">江汉</option>
				<option value="2">全武汉</option>
			</select>
-->
<!--
		<a href="addGeneralize.jsp" class="weui_btn weui_btn_warn" style="color:#ffffff">发布</a>
-->
<!--
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择最小年龄</option>
				<option value="1">北京</option>
				<option value="2">上海</option>
			</select>
			<select onchange="change(this);" class="weui_form_input" style="width:50%;color:#A5A5A5;" name="select2">
				<option selected>请选择最大年龄</option>
				<option value="1">江汉</option>
				<option value="2">全武汉</option>
			</select>
-->
<!--
			<select onchange="change(this);" class="weui_form_input" style="width:100%;color:#A5A5A5;" name="select2">
				<option selected>请选择工作经验</option>
				<option value="1">北京</option>
				<option value="2">上海</option>
			</select>
-->
<!--
			<select onchange="change(this);" class="weui_form_input" style="width:100%;color:#A5A5A5;" name="select2">
				<option selected>请选择学历要求</option>
				<option value="1">北京</option>
				<option value="2">上海</option>
			</select>
-->

*/
